<template>
    <div>
        <ul>
            <li v-for="item in arr" :key="item">
                <span @dblclick="shuangji(item)" v-if="item.checked">{{item.title}}</span>
                <input type="text"  v-on:keyup.enter="jianpan(item)" v-else v-model="item.title">
            </li>
        </ul>
    </div>
</template>
<style scoped>
    li{
        list-style: none;
    }
</style>
<script>

export default{
    data() {
        return{
            arr:[{title:"123",checked:true},{title:"456",checked:true}]
        }
    },
    methods:{
        shuangji(item){
            item.checked=!item.checked
        },
        jianpan(item){
            item.checked=!item.checked
        }
    }
}
</script>
